import React from 'react';

const UploadFileInput = React.createClass({
  onChange(e) {
    if (this.props.onChange) {
      this.props.onChange(e);
    }
  },
  render() {
    return (
      <a className={this.props.className ? this.props.className : ' default-upload-button'} >
        {this.props.buttonMsg ? this.props.buttonMsg : '选择测试包上传'}
        <input
          className={this.props.InputClass ? this.props.InputClass : ''}
          type="file" id={this.props.id ? this.props.id : 'defualt_upload'}
          name="file" onChange={this.onChange}
          accept={this.props.accept ? this.props.accept : '*'}
          value={this.props.value}
        />
      </a>
    );
  }
});

export default UploadFileInput;
